# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Language.V2.Model.XPSColorMap do
  @moduledoc """
  Map from color to display name. Will only be used by Image Segmentation for uCAIP.

  ## Attributes

  *   `annotationSpecIdToken` (*type:* `String.t`, *default:* `nil`) - Should be used during training.
  *   `color` (*type:* `GoogleApi.Language.V2.Model.Color.t`, *default:* `nil`) - This type is deprecated in favor of the IntColor below. This is because google.type.Color represent color has a float which semantically does not reflect discrete classes/categories concept. Moreover, to handle it well we need to have some tolerance when converting to a discretized color. As such, the recommendation is to have API surface still use google.type.Color while internally IntColor is used.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - Should be used during preprocessing.
  *   `intColor` (*type:* `GoogleApi.Language.V2.Model.XPSColorMapIntColor.t`, *default:* `nil`) - 
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :annotationSpecIdToken => String.t() | nil,
          :color => GoogleApi.Language.V2.Model.Color.t() | nil,
          :displayName => String.t() | nil,
          :intColor => GoogleApi.Language.V2.Model.XPSColorMapIntColor.t() | nil
        }

  field(:annotationSpecIdToken)
  field(:color, as: GoogleApi.Language.V2.Model.Color)
  field(:displayName)
  field(:intColor, as: GoogleApi.Language.V2.Model.XPSColorMapIntColor)
end

defimpl Poison.Decoder, for: GoogleApi.Language.V2.Model.XPSColorMap do
  def decode(value, options) do
    GoogleApi.Language.V2.Model.XPSColorMap.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Language.V2.Model.XPSColorMap do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
